package cn.antia.db;

/**
 * User: Jair Shaw
 * Date: 2008-6-30
 * Time: 11:02:08
 */
public class OracleSQLGene extends AbstractSQLGene{

    public String composeSql(String sql, String orderField, boolean isAsc, int start, int end) {
        sql = cutOrderBySql(sql);
        sql = sql + " ORDER BY " + orderField + (isAsc ? " ASC " : " DESC ");
        sql = "select * from(select row_.*, rownum rownum_ from (" + sql + ") row_ where rownum <= " + end + ") where rownum_ > " + start;
        return sql;
    }
}
